package com.ruoyi.smile.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smile.mapper.McDynamicContentMapper;
import com.ruoyi.smile.domain.McDynamicContent;
import com.ruoyi.smile.service.IMcDynamicContentService;

/**
 * 动态内容Service业务层处理
 * 
 * @author xin
 * @date 2025-03-08
 */
@Service
public class McDynamicContentServiceImpl implements IMcDynamicContentService 
{
    @Autowired
    private McDynamicContentMapper mcDynamicContentMapper;

    /**
     * 查询动态内容
     * 
     * @param id 动态内容主键
     * @return 动态内容
     */
    @Override
    public McDynamicContent selectMcDynamicContentById(Long id)
    {
        return mcDynamicContentMapper.selectMcDynamicContentById(id);
    }

    /**
     * 查询动态内容列表
     * 
     * @param mcDynamicContent 动态内容
     * @return 动态内容
     */
    @Override
    public List<McDynamicContent> selectMcDynamicContentList(McDynamicContent mcDynamicContent)
    {
        return mcDynamicContentMapper.selectMcDynamicContentList(mcDynamicContent);
    }

    /**
     * 新增动态内容
     * 
     * @param mcDynamicContent 动态内容
     * @return 结果
     */
    @Override
    public int insertMcDynamicContent(McDynamicContent mcDynamicContent)
    {
        mcDynamicContent.setCreateTime(DateUtils.getNowDate());
        return mcDynamicContentMapper.insertMcDynamicContent(mcDynamicContent);
    }

    /**
     * 修改动态内容
     * 
     * @param mcDynamicContent 动态内容
     * @return 结果
     */
    @Override
    public int updateMcDynamicContent(McDynamicContent mcDynamicContent)
    {
        mcDynamicContent.setUpdateTime(DateUtils.getNowDate());
        return mcDynamicContentMapper.updateMcDynamicContent(mcDynamicContent);
    }

    /**
     * 批量删除动态内容
     * 
     * @param ids 需要删除的动态内容主键
     * @return 结果
     */
    @Override
    public int deleteMcDynamicContentByIds(Long[] ids)
    {
        return mcDynamicContentMapper.deleteMcDynamicContentByIds(ids);
    }

    /**
     * 删除动态内容信息
     * 
     * @param id 动态内容主键
     * @return 结果
     */
    @Override
    public int deleteMcDynamicContentById(Long id)
    {
        return mcDynamicContentMapper.deleteMcDynamicContentById(id);
    }
}
